import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

import Layout from '@/views/Layout'
import Login from '@/views/Login'
import Home from '@/views/Home'
const Product = ()=>import('@/views/Product/index.vue')
const ProductCategory = ()=>import('@/views/Product/category/index.vue')
const ProductList = ()=>import('@/views/Product/list/index.vue')
const Order = ()=>import('@/views/Order/index.vue')
const OrderList = ()=>import('@/views/Order/list/index.vue')
const OrderCollect = ()=>import('@/views/Order/collect/index.vue')
const Advert = ()=>import('@/views/Advert/index.vue')
const AdvertList = ()=>import('@/views/Advert/list/index.vue')
export const routes = [

  {

    path:'/',
    component:Layout,
    children:[

      {
        path:'/',
        name:'home',
        component:Home,
      },
      {
        path:'/product',
        name:'product',
        component:Product,
        children:[

          {
            path:'product-list',
            name:'product-list',
            component:ProductList,
          },
          {
            path:'product-category',
            name:'product-category',
            component:ProductCategory,
          }

        ]
      },
      {
        path:'/order',
        name:'order',
        component:Order,
        children:[
          {
            path:'order-list',
            name:'order-list',
            component:OrderList,
          },
          {
            path:'order-collect',
            name:'order-collect',
            component:OrderCollect,
          }
        ]
      },
      {
        path:'/advert',
        name:'advert',
        component:Advert,
        children:[

          {
            path:'advert-list',
            name:'advert-list',
            component:AdvertList,
          }

        ]
      }
    ]

  },
  {
    path:'/login',
    name:'login',
    component:Login
  }
]
const router =  new VueRouter({


  mode:'history',
  base: process.env.BASE_URL,
  routes

})

export default router